package br.com.rcbsystens.promotora.model.propostaweb;

import javax.persistence.EntityManager;

import br.com.rcbsystens.promotora.model.dao.JpaUtil;

public class PropostaWebDao {
	
	public void salvar(PropostaWeb proposta){
		EntityManager manager = JpaUtil.getEntityManager();
		try {
			manager.getTransaction().begin();
			manager.persist(proposta);
			manager.getTransaction().commit();
		} catch (Exception e) {
			// TODO: handle exception
			System.out.println("Não foi possivel salvar proposta. Erro: "+e.getMessage());
		}finally{
			manager.close();			
		}
	}

}
